package com.exp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.exp.dto.DeptPageQueryDTO;
import com.exp.dto.EmployeePageQueryDTO;
import com.exp.mapper.EmployeeInfMapper;
import com.exp.pojo.JobInf;
import com.exp.pojo.UserInf;
import com.exp.result.PageResult;
import com.exp.service.EmployeeInfService;
import com.exp.pojo.EmployeeInf;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* @author 王-自信
* @description 针对表【employee_inf】的数据库操作Service实现
* @createDate 2024-11-18 20:52:04
*/
@Service
public class EmployeeInfServiceImpl extends ServiceImpl<EmployeeInfMapper, EmployeeInf>
    implements EmployeeInfService {

    @Autowired
    private EmployeeInfMapper employeeInfMapper;
    @Override
    public PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO) {
        PageHelper.startPage(employeePageQueryDTO.getPage(), employeePageQueryDTO.getPageSize());
        Page<EmployeeInf> page = employeeInfMapper.pageQuery(employeePageQueryDTO);

        long total = page.getTotal();
        List<EmployeeInf> records = page.getResult();
        return new PageResult(total, records);
    }

    @Override
    public void update(EmployeeInf employeeInf) {
        employeeInfMapper.update(employeeInf);
    }

    @Override
    public void deleteBatch(List<Integer> ids) {
        //删除数据
        for (Integer id : ids) {
            employeeInfMapper.deleteById(id);
        }
    }
}




